<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对象的遍历</title>
</head>
<body>
    <script>
        var obj = {name:'张三',age:12,gender:'男'};
        document.write('使用 for in 遍历对象时，i 为属性名，obj为对象，obj[i]为属性值。<br>');
        for(i in obj){
            document.write( i ,obj[i], i ,obj[i], i ,obj[i] +'<br>')
        }
    </script>
</body>
</html>